package ac.svn.accesscontrol.ui;

import java.awt.Component;
import java.awt.Insets;

import javax.swing.border.EtchedBorder;

public class MarginBorder extends EtchedBorder
{
	private int horitontalInset 		= 2;
	private int verticalInset 	= 2;
	
	public MarginBorder(int horitontalInset,int verticalInset)
	{
		this.horitontalInset 	= horitontalInset;
		this.verticalInset		= verticalInset;
	}
	
	public MarginBorder() {
	  super(RAISED);
	}
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Override
	public Insets getBorderInsets(Component arg0, Insets arg1) {
	    Insets insets = super.getBorderInsets(arg0, arg1);  
	    insets.bottom 	= insets.bottom + verticalInset;
	    insets.left 	= insets.left 	+ horitontalInset;
	    insets.right 	= insets.right 	+ horitontalInset;
	    insets.top 		= insets.top 	+ verticalInset;
	    return insets;
	}

	@Override
	public Insets getBorderInsets(Component arg0) {
	    Insets insets = super.getBorderInsets(arg0);  
	    insets.bottom 	= insets.bottom + verticalInset;
	    insets.left 	= insets.left 	+ horitontalInset;
	    insets.right 	= insets.right 	+ horitontalInset;
	    insets.top 		= insets.top 	+ verticalInset;
	    return insets;
	}
	
}
